package com.redeemer150.oj;


import com.redeemer150.oj.service.QuestionService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @author 黄宽亮
 * @version 1.0
 * @description: TODO
 * @date 2025/5/14 16:43
 */
@SpringBootTest
public class test01 {
    @Resource
    private QuestionService questionService;
    @Test
    public void test(){
                Properties props = new Properties();

                // 添加一些属性
                props.setProperty("name", "huangkuanliang");
                props.setProperty("age", "21");
                props.setProperty("city", "chongqing");

                try (FileOutputStream output = new FileOutputStream("D:/config.properties")) {
                    // 将Properties对象保存到文件
                    props.store(output, "This is a comment line");
                    System.out.println("Properties saved successfully to D:/config.properties");
                } catch (IOException e) {
                    e.printStackTrace();
                    System.out.println("Error occurred while saving the properties to the file.");
                }
            }
        }


